package org.musicsweet.task;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 使用计时器  需要在启动类增加@EnableScheduling这个注解
 */
@Component
public class QuartzTask {
    @Scheduled(cron = "0/5 * * * * ? ")
    public void runTask(){
        System.out.println("定时运行");
    }
}
